package com.threads;

import java.util.Date;

import com.enetiy.Netclick;
import com.service.AreausbleService;
import com.util.Log4gUtil;
/**
 * 添加网络点击次数线程
 * @author hzy
 *
 */
public class AddNetclickThread implements Runnable {
		public int userid;
		public String mac;
		public String ip;
		public int areaid;
		public int mac_type;
		public int server_type;
		
		public AreausbleService areausbleService;
		
		
		public AddNetclickThread(int userid, String mac, String ip, int areaid,
				int mac_type, int server_type,AreausbleService areausbleService) {
			super();
			this.userid = userid;
			this.mac = mac;
			this.ip = ip;
			this.areaid = areaid;
			this.mac_type = mac_type;
			this.server_type = server_type;
			this.areausbleService = areausbleService;
		}
		public AddNetclickThread() {
			super();
		}
		@Override
		public void run() {
			Netclick net= new Netclick(userid, mac, ip, new Date(), areaid, mac_type, server_type);
			try {
				areausbleService.insertNetclick(net);
			} catch (Exception e) {
				Log4gUtil.getLog().info("添加网络上线数异常"+userid+"--"+mac+"--"+ip);
			}
		}
		
		
}
